  <% if @collection.any? %>
    <div data-controller="bulk-operation" data-action="keydown.esc->bulk-operation#cancel" tabindex="0">
      <%= form_tag spree.admin_products_path, method: :put, data: { 'bulk-operation-target': 'form' } do %>
        <%= render 'shared/bulk_modal' %>
        <div id="bulk-panel" class="d-none" data-bulk-operation-target="panel">
          <div class="bulk-panel-container animate__animated animate__bounceInUp animate__faster">
            <div data-toggle="modal" data-target="#bulk-modal">
              <% if can?(:activate, Spree::Product) %>
                <a href="<%= spree.bulk_modal_admin_products_path(kind: :set_status, status: :active) %>"
                  data-turbo-frame="bulk_modal" class="btn btn-primary mr-2 d-vendor"
                  data-action="click->bulk-operation#setBulkAction"
                  data-url="<%= spree.bulk_status_update_admin_products_path(status: :active) %>">
                  <%= icon('check') %>
                  <%= Spree.t('admin.bulk_ops.products.title.set_status', status: :active) %>
                </a>
              <% end %>
              <a href="<%= spree.bulk_modal_admin_products_path(kind: :set_status, status: :draft) %>"
                data-turbo-frame="bulk_modal"
                class="btn btn-light mr-2"
                data-action="click->bulk-operation#setBulkAction"
                data-url="<%= spree.bulk_status_update_admin_products_path(status: :draft) %>"
              >
                <%= Spree.t('admin.bulk_ops.products.title.set_status', status: :draft) %>
              </a>
            </div>

            <div class="dropdown dropup mr-3 ml-1" role="group">
              <button type="button" data-display="static" class="btn btn-light px-2 h-100" data-placement="bottom" data-toggle="dropdown" aria-expanded="false">
                <%= icon('dots', class: 'mr-0') %>
              </button>
              <div class="dropdown-menu dropdown-menu-left" aria-labelledby="btnGroupDrop1" data-toggle="modal" data-target="#bulk-modal">
                <a href="<%= spree.bulk_modal_admin_products_path(kind: :set_status, status: :archived) %>"
                  data-turbo-frame="bulk_modal" class="dropdown-item"
                  data-action="click->bulk-operation#setBulkAction"
                  data-url="<%= spree.bulk_status_update_admin_products_path(status: :archived) %>">
                  <%= Spree.t('admin.bulk_ops.products.title.set_status', status: :archived) %>
                </a>
                <% if can?(:manage, Spree::Classification) %>
                  <div class="dropdown-divider"></div>
                  <a href="<%= spree.bulk_modal_admin_products_path(kind: :add_to_taxons) %>"
                    data-turbo-frame="bulk_modal" class="dropdown-item"
                    data-action="click->bulk-operation#setBulkAction"
                    data-url="<%= spree.bulk_add_to_taxons_admin_products_path %>">
                    <%= Spree.t('admin.bulk_ops.products.title.add_to_taxons') %>
                  </a>
                  <a href="<%= spree.bulk_modal_admin_products_path(kind: :remove_from_taxons) %>"
                    data-turbo-frame="bulk_modal" class="dropdown-item"
                    data-action="click->bulk-operation#setBulkAction"
                    data-url="<%= spree.bulk_remove_from_taxons_admin_products_path %>">
                    <%= Spree.t('admin.bulk_ops.products.title.remove_from_taxons') %>
                  </a>
                <% end %>

                <% if can?(:manage_tags, Spree::Product) %>
                  <div class="dropdown-divider"></div>
                  <a href="<%= spree.bulk_modal_admin_products_path(kind: :add_tags) %>"
                    data-turbo-frame="bulk_modal" class="dropdown-item"
                    data-action="click->bulk-operation#setBulkAction"
                    data-url="<%= spree.bulk_add_tags_admin_products_path %>">
                    <%= Spree.t('admin.bulk_ops.products.title.add_tags') %>
                  </a>
                  <a href="<%= spree.bulk_modal_admin_products_path(kind: :remove_tags) %>"
                    data-turbo-frame="bulk_modal" class="dropdown-item"
                    data-action="click->bulk-operation#setBulkAction"
                    data-url="<%= spree.bulk_remove_tags_admin_products_path %>">
                    <%= Spree.t('admin.bulk_ops.products.title.remove_tags') %>
                  </a>
                <% end %>
              </div>
            </div>

            <span>
              <strong data-bulk-operation-target="counter"></strong> <%= Spree.t('admin.products.selected') %>
            </span>

            <button type="button" class="btn-close ml-2" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" data-action="bulk-operation#cancel" />
          </div>
        </div>

        <div class="table-responsive">
          <table class="table" id="listing_products">
            <thead class="text-muted">
              <tr>
                <th scope="col" class="pr-0 w-5">
                  <div class="custom-control custom-checkbox ml-1">
                    <input type="checkbox" class="custom-control-input" id="checkAllMasterCheckbox" data-bulk-operation-target="checkboxAll">
                    <label class="custom-control-label" for="checkAllMasterCheckbox"><span></span></label>
                  </div>
                </th>
                <th scope="col">
                  <%= sort_link @search,:name, Spree.t(:name), { default_order: "desc" }, {title: 'admin_products_listing_name_title'} %>
                </th>
                <th scope="col" class="text-center">
                  <%= Spree.t(:status) %>
                  <%= help_bubble(Spree.t('admin.products.help_bubble')) %>
                </th>
                <th scope="col"><%= Spree.t(:inventory) %></th>
                <% if defined?(current_vendor) %>
                  <th scope="col" class="d-vendor"><%= Spree.t(:vendor) %></th>
                <% end %>
                <th scope="col"><%= Spree.t(:price) %></th>
              </tr>
            </thead>
            <tbody>
              <%= render partial: 'spree/admin/products/product', collection: @collection, cached: spree_base_cache_scope %>
            </tbody>
          </table>
        </div>
      <% end %>
    </div>
    <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
  <% else %>
    <%= render partial: 'spree/admin/products/empty_list' %>
  <% end %>
